#include<iostream>
using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	int a[3];
	if (n == 1)
	{
		cin >> a[0];
		cout << a[0];
		return 0;
	}
	int tmp[2] = { 0 };
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	int goal = 0;
	for (int i = 1; i < n; i++)
	{
		tmp[0] += a[i];
	}
	for (int i = 1; i < n - 1; i++)
	{
		tmp[i] = tmp[i - 1] - a[i];
	}
	for (int i = 0; i < n - 1; i++)
	{
		goal += a[i] * tmp[i];
	}
	cout << goal;
	return 0;
}